﻿using MahApps.Metro.Controls;
using Newtonsoft.Json.Linq;
using ShanghaiMetroAPP.Helper;
using ShanghaiMetroAPP.MetroDraw;
using ShanghaiMetroAPP.Model.SMAPPControl;
using ShanghaiMetroAPP.ViewModel;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ShanghaiMetroAPP
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : MetroWindow
    {
        //TODO:Norman Lee, 线路绘制
        //TODO:Leopard, 地图放大功能，Wait Norman Lee, 线路绘制
        public MainWindow()
        {
            
            InitializeComponent();

            

            testDraw();
        }
        private void testDraw()
        {
            //加载所有站点信息
            var stations = Station.LoadStations(this);
            //去重(去掉各线换乘站)
            var exitsStationName = new List<string>();
            foreach(var element in stations)
            {
                if (!exitsStationName.Contains(element.Name))
                {
                    //不存在
                    exitsStationName.Add(element.Name);
                    var shape = element.ToShape();
                    canvas.Children.Add(shape);
                    canvas.Children.Add(element.ToText());
                }
            }
        }
    }
}
